// Draw

SS.Draw = {}

// Bar

function SS.Draw.Bar()
	if (SS.Lib.HiddenGUI(SS.Client, "Bar")) then return end
	
	if (GetConVarNumber("ss_showbar") == 0) then
		surface.SetFont(SS.GUI.Font)
		
		local Text = "The bar GUI has been disabled!"
		
		local W, H = surface.GetTextSize(Text)
		
		W = W + 16
		
		draw.RoundedBox(6, 4, 4, W, 24, Color(50, 50, 50, 150))
		
		draw.SimpleText(Text, SS.GUI.Font, 5 + (W / 2), 5 + (24 / 2), Color(0, 0, 0, 200), 1, 1)
		draw.SimpleText(Text, SS.GUI.Font, 4 + (W / 2), 4 + (24 / 2), Color(255, 255, 255, 255), 1, 1)
		
		return
	end
	
	local Colour = SS.Lib.GetTeamColor()
	
	SS.ServerTicker.Draw(Colour)
	
	local Data = SS.Parts.Request(SS.Client, "Bar")
	
	local Col = Color(50, 50, 50, 200)
	
	local Height = 24
	
	draw.RoundedBox(0, 0, 0, ScrW(), Height, Col)
	
	draw.RoundedBox(0, 0, Height, ScrW(), 2, Colour)
	
	local Col = Color(255, 255, 255, 255)
	
	local Text = table.concat(Data, "\t")
	
	draw.SimpleText(Text, "Default", 6, 6, Color(0, 0, 0, 255), 0, 0)
	draw.SimpleText(Text, "Default", 5, 5, Col, 0, 0)
end

hook.Add("HUDDrawScoreBoard", "SS.Draw.Bar", SS.Draw.Bar)